Enviado por: eliascm36
Fecha: 2005-02-24 19:38:13
Actualizado: 2005-09-09 04:25:33
¿Usa base de datos?: 0
Fecha: 2005-02-24 19:38:13
Actualizado: 2005-09-09 04:25:33
¿Usa base de datos?: 0
Visitas: 899
Votos: 2
Descargado: 195 veces
Votos: 2
Descargado: 195 veces
Este script es para poder anunciar en forma de tabla, la trayectoria de un tornero: Cuartos de Final, Semifinales, y la final. Ya mas adelante pasare un script, para que los administradores tengan una sesion. Muy Pronto Version 2.0 Con MySQL y Administradores =O... Esperala... Este script consta de 3 partes: tabladeportes.php, registrartabladeportes.php, editartabladeportes.php Y una carpeta: torneo. [b]tabladeportes.php[/b] [codigo] <? include("torneo/datostabla.php");?> <? //************************************ //***********Realizado Por:*********** //*************eliascm36************** //**************Version:************** //****************1.0***************** //************************************ ?> <? include("config.php") ?> <? $consulta = mysql_query("select email from usuarios order by id desc") ; while($datos = mysql_fetch_array($consulta)) { ?> <? $nuevo .= "<?"; $nuevo .= "="; $nuevo .= "'"; $nuevo .= "$datos[email],"; $nuevo .= "' ;"; $nuevo .= "?>"; $crea = fopen("datos/boletin.php","w"); fputs($crea,$nuevo); fclose($crea); ?> <? } ?> <? if($_POST[enviar]) { mail($_POST[boletin],$_POST[asunto],$_POST[mensaje],"From: $_POST[nombre] <$_POST[email]>") ; echo "El email ha sido enviado con �xito." ; } ?> <form method="post" action="<?=$_SERVER[PHP_SELF]?>"> Usuarios:<br> <input name="boletin" type="text" id="boletin" value="<? include("datos/boletin.php") ?>"> <br> Nombre:<br> <input name="nombre" type="text"> <br> Email:<br> <input name="email" type="text" id="email"><br> Asunto:<br> <input name="asunto" type="text" id="asunto"> <br> Mensaje:<br> <textarea name="mensaje" cols="30" rows="5"></textarea> <br> <br> <input type="submit" name="enviar" value="Enviar"> </form> <body> <p><strong>Nombre Del Torneo: <?=$nombre?> </strong></p> <table width="819" height="483" border="1"> <tr> <td width="118" height="23"><strong>Cuartos de Final</strong></td> <td width="196"><strong>Partido 1</strong></td> <td width="157"><strong>Partido 2</strong></td> <td width="157"><strong>Partido 3</strong></td> <td width="157"><strong>Partido 4</strong></td> </tr> <tr> <td>&nbsp;</td> <td> <p><strong> <?=$cuartos?> Vs <?=$cuartos2?> </strong></p> <p>Resultado: <strong> <?=$resultado?> </strong><strong> </strong></p></td> <td> <p><strong> <?=$cuartos3?> Vs <?=$cuartos4?> </strong></p> <p>Resultado: <strong> <?=$resultado2?> </strong></p></td> <td> <p><strong> <?=$cuartos5?> Vs <?=$cuartos6?> </strong></p> <p>Resultado: <strong> <?=$resultado3?> </strong></p></td> <td> <p><strong> <?=$cuartos7?> Vs <?=$cuartos8?> </strong></p> <p>Resultado: <strong> <?=$resultado4?> </strong></p></td> </tr> <tr> <td height="23"><strong>Semifinales</strong></td> <td><strong>Partido 1</strong></td> <td><strong>Partido 2</strong></td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td> <p><strong> <?=$semifinal?> Vs <?=$semifinal2?> </strong></p> <p>Resultado: <strong> <?=$resultado5?> </strong></p></td> <td> <p><strong> <?=$semifinal3?> Vs <?=$semifinal4?> </strong></p> <p>Resultado: <strong> <?=$resultado6?> </strong></p></td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td height="23"><strong>Final</strong></td> <td><strong>Partido 1</strong></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><p><strong><font color="#000000"> <?=$final?> Vs <?=$final2?> </font></strong></p> <p>Resultado: <strong> <?=$resultado7?> </strong></p></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> </body> </html> [/codigo] [b]registrartabladeportes.php[/b] [codigo] <? //************************************ //***********Realizado Por:*********** //*************eliascm36************** //**************Version:************** //****************1.0***************** //************************************ ?> <? include("config.php") ?> <? $consulta = mysql_query("select email from usuarios order by id desc") ; while($datos = mysql_fetch_array($consulta)) { ?> <? $nuevo .= "<?"; $nuevo .= "="; $nuevo .= "'"; $nuevo .= "$datos[email],"; $nuevo .= "' ;"; $nuevo .= "?>"; $crea = fopen("datos/boletin.php","w"); fputs($crea,$nuevo); fclose($crea); ?> <? } ?> <? if($_POST[enviar]) { mail($_POST[boletin],$_POST[asunto],$_POST[mensaje],"From: $_POST[nombre] <$_POST[email]>") ; echo "El email ha sido enviado con �xito." ; } ?> <form method="post" action="<?=$_SERVER[PHP_SELF]?>"> Usuarios:<br> <input name="boletin" type="text" id="boletin" value="<? include("datos/boletin.php") ?>"> <br> Nombre:<br> <input name="nombre" type="text"> <br> Email:<br> <input name="email" type="text" id="email"><br> Asunto:<br> <input name="asunto" type="text" id="asunto"> <br> Mensaje:<br> <textarea name="mensaje" cols="30" rows="5"></textarea> <br> <br> <input type="submit" name="enviar" value="Enviar"> </form> <? if($registrar) { function quitar($texto) { $texto = trim($texto) ; $texto = htmlspecialchars($texto) ; return $texto ; } $nuevo .= "<"."?\n"; $nuevo .="\$nombre = \"$nombre\";\n"; $nuevo .="\$cuartos = \"$cuartos\";\n"; $nuevo .="\$cuartos2 = \"$cuartos2\";\n"; $nuevo .="\$cuartos3 = \"$cuartos3\";\n"; $nuevo .="\$cuartos4 = \"$cuartos4\";\n"; $nuevo .="\$cuartos5 = \"$cuartos5\";\n"; $nuevo .="\$cuartos6 = \"$cuartos6\";\n"; $nuevo .="\$cuartos7 = \"$cuartos7\";\n"; $nuevo .="\$cuartos8 = \"$cuartos8\";\n"; $nuevo .="\$semifinal = \"$semifinal\";\n"; $nuevo .="\$semifinal2 = \"$semifinal2\";\n"; $nuevo .="\$semifinal3 = \"$semifinal3\";\n"; $nuevo .="\$semifinal4 = \"$semifinal4\";\n"; $nuevo .="\$final = \"$final\";\n"; $nuevo .="\$final2 = \"$final2\";\n"; $nuevo .="\$resultado = \"$resultado\";\n"; $nuevo .="\$resultado2 = \"$resultado2\";\n"; $nuevo .="\$resultado3 = \"$resultado3\";\n"; $nuevo .="\$resultado4 = \"$resultado4\";\n"; $nuevo .="\$resultado5 = \"$resultado5\";\n"; $nuevo .="\$resultado6 = \"$resultado6\";\n"; $nuevo .="\$resultado7 = \"$resultado7\";\n"; $nuevo .= "?".">"; $crea = fopen("torneo/datostabla.php","w"); fputs($crea,$nuevo); fclose($crea); echo "Se a registrado el torneo con �xito. Haz click <a href=tabladeportes.php>aqu�</a> para ir a la Tabla." ; } else { ?> <p>Instrucciones: Se pueden dejar en blanco. <form name="formulario" method="post" action="registrartabladeportes.php" onsubmit="return revisar()"> <div align="center"> <b>Nombre del Torneo</b>:<br> <input name="nombre" type="text" id="nombre" maxlength="20" class="form"> <br> <b>Los Que Pasaron a Los Cuartos de Final:</b><br> <b>____________Partido 1____________</b><br> <strong>Equipo 1 </strong><br> <input name="cuartos" type="text" id="cuartos" maxlength="20" class="form"> <br> <b>Equipo 2</b><br> <input name="cuartos2" type="text" id="cuartos2" maxlength="20" class="form"> <br> <b>Resultado</b><br> <input name="resultado" type="text" class="form" id="resultado" size="5" maxlength="20"> <br> <b>____________Partido 2</b><b>____________</b><br> <b>Equipo 1</b><br> <input name="cuartos3" type="text" id="cuartos3" maxlength="20" class="form"> <br> <b>Equipo 2</b><br> <input name="cuartos4" type="text" id="cuartos4" maxlength="20" class="form"> <br> <b>Resultado</b><br> <input name="resultado2" type="text" class="form" id="resultado2" size="5" maxlength="20"> <br> <b>____________Partido 3</b><b>____________</b><br> <b>Equipo 1</b><br> <input name="cuartos5" type="text" id="cuartos5" maxlength="20" class="form"> <br> <b>Equipo 2</b><br> <input name="cuartos6" type="text" id="cuartos6" maxlength="20" class="form"> <br> <b>Resultado</b><br> <input name="resultado3" type="text" class="form" id="resultado3" size="5" maxlength="20"> <br> <b>____________Partido 4</b><b>____________</b><br> <b>Equipo 1</b><br> <input name="cuartos7" type="text" id="cuartos7" maxlength="20" class="form"> <br> <b>Equipo 2</b><br> <input name="cuartos8" type="text" id="cuartos8" maxlength="20" class="form"> <br> <b>Resultado</b><br> <input name="resultado4" type="text" class="form" id="resultado4" size="5" maxlength="20"> <br> <b>_________________________________________________________</b><br> <b>Equipos que pasaron a la Semifinal</b><br> <b> ____________Partido 1</b><b>____________</b><br> <b>Equipo 1:</b><br> <input name="semifinal" type="text" id="semifinal" maxlength="20" class="form"> <br> <b>Equipo 2:</b><br> <input name="semifinal2" type="text" id="semifinal" maxlength="20" class="form"> <br> <b>Resultado</b><br> <input name="resultado5" type="text" class="form" id="resultado5" size="5" maxlength="20"> <br> <b> ____________Partido 2</b><b>____________</b><br> <b>Equipo 1:</b><br> <input name="semifinal3" type="text" id="semifinal3" maxlength="20" class="form"> <br> <b>Equipo 2:</b><br> <input name="semifinal4" type="text" id="semifinal4" maxlength="20" class="form"> <br> <b>Resultado</b><br> <input name="resultado6" type="text" class="form" id="resultado6" size="5" maxlength="20"> <br> <b>_________________________________________________________</b><br> <b>Equipo que pasaron a la Final</b><br> <b>____________Partido 1</b><b>____________</b><br> <b>Equipo 1</b><br> <input name="final" type="text" id="final" maxlength="40" class="form"> <br> <b>Equipo 2</b><br> <input name="final2" type="text" id="final2" maxlength="40" class="form"> <br> <b>Resultado</b><br> <input name="resultado7" type="text" class="form" id="resultado7" size="5" maxlength="20"> <br> <br> <input type="submit" name="registrar" value="Registrar" class="form"> </div> </form> <? } ?> [/codigo] [b]editartabladeportes.php[/b] [codigo] <? include("torneo/datostabla.php");?> <? //************************************ //***********Realizado Por:*********** //*************eliascm36************** //**************Version:************** //****************1.0***************** //************************************ ?> <? include("config.php") ?> <? $consulta = mysql_query("select email from usuarios order by id desc") ; while($datos = mysql_fetch_array($consulta)) { ?> <? $nuevo .= "<?"; $nuevo .= "="; $nuevo .= "'"; $nuevo .= "$datos[email],"; $nuevo .= "' ;"; $nuevo .= "?>"; $crea = fopen("datos/boletin.php","w"); fputs($crea,$nuevo); fclose($crea); ?> <? } ?> <? if($_POST[enviar]) { mail($_POST[boletin],$_POST[asunto],$_POST[mensaje],"From: $_POST[nombre] <$_POST[email]>") ; echo "El email ha sido enviado con �xito." ; } ?> <form method="post" action="<?=$_SERVER[PHP_SELF]?>"> Usuarios:<br> <input name="boletin" type="text" id="boletin" value="<? include("datos/boletin.php") ?>"> <br> Nombre:<br> <input name="nombre" type="text"> <br> Email:<br> <input name="email" type="text" id="email"><br> Asunto:<br> <input name="asunto" type="text" id="asunto"> <br> Mensaje:<br> <textarea name="mensaje" cols="30" rows="5"></textarea> <br> <br> <input type="submit" name="enviar" value="Enviar"> </form> <? if($registrar) { function quitar($texto) { $texto = trim($texto) ; $texto = htmlspecialchars($texto) ; return $texto ; } $nuevo .= "<"."?\n"; $nuevo .="\$nombre = \"$nombre\";\n"; $nuevo .="\$cuartos = \"$cuartos\";\n"; $nuevo .="\$cuartos2 = \"$cuartos2\";\n"; $nuevo .="\$cuartos3 = \"$cuartos3\";\n"; $nuevo .="\$cuartos4 = \"$cuartos4\";\n"; $nuevo .="\$cuartos5 = \"$cuartos5\";\n"; $nuevo .="\$cuartos6 = \"$cuartos6\";\n"; $nuevo .="\$cuartos7 = \"$cuartos7\";\n"; $nuevo .="\$cuartos8 = \"$cuartos8\";\n"; $nuevo .="\$semifinal = \"$semifinal\";\n"; $nuevo .="\$semifinal2 = \"$semifinal2\";\n"; $nuevo .="\$semifinal3 = \"$semifinal3\";\n"; $nuevo .="\$semifinal4 = \"$semifinal4\";\n"; $nuevo .="\$final = \"$final\";\n"; $nuevo .="\$final2 = \"$final2\";\n"; $nuevo .="\$resultado = \"$resultado\";\n"; $nuevo .="\$resultado2 = \"$resultado2\";\n"; $nuevo .="\$resultado3 = \"$resultado3\";\n"; $nuevo .="\$resultado4 = \"$resultado4\";\n"; $nuevo .="\$resultado5 = \"$resultado5\";\n"; $nuevo .="\$resultado6 = \"$resultado6\";\n"; $nuevo .="\$resultado7 = \"$resultado7\";\n"; $nuevo .= "?".">"; $crea = fopen("w"); fputs($crea,$nuevo); fclose($crea); echo "Han sido editados con �xito. Haz click <a href=tabladeportes.php>aqu�</a> para ir a la Tabla." ; } else { ?> <p>Instrucciones: Se pueden dejar en blanco. <form name="formulario" method="post" action="registrartabladeportes.php" onsubmit="return revisar()"> <div align="center"> <b>Nombre del Torneol</b>:<br> <input name="nombre" type="text" class="form" id="nombre" value="<?=$nombre?>" maxlength="20"> <br> <b>Los Que Pasaron a Los Cuartos de Final:</b><br> <b>____________Partido 1____________</b><br> <strong>Equipo 1 </strong><br> <input name="cuartos" type="text" class="form" id="cuartos" value="<?=$cuartos?>" maxlength="20"> <br> <b>Equipo 2</b><br> <input name="cuartos2" type="text" class="form" id="cuartos2" value="<?=$cuartos2?>" maxlength="20"> <br> <b>Resultado</b><br> <input name="resultado" type="text" class="form" id="resultado" value="<?=$resultado?>" size="5" maxlength="20"> <br> <b>____________Partido 2</b><b>____________</b><br> <b>Equipo 1</b><br> <input name="cuartos3" type="text" class="form" id="cuartos3" value="<?=$cuartos3?>" maxlength="20"> <br> <b>Equipo 2</b><br> <input name="cuartos4" type="text" class="form" id="cuartos4" value="<?=$cuartos4?>" maxlength="20"> <br> <b>Resultado</b><br> <input name="resultado2" type="text" class="form" id="resultado2" value="<?=$resultado2?>" size="5" maxlength="20"> <br> <b>____________Partido 3</b><b>____________</b><br> <b>Equipo 1</b><br> <input name="cuartos5" type="text" class="form" id="cuartos5" value="<?=$cuartos5?>" maxlength="20"> <br> <b>Equipo 2</b><br> <input name="cuartos6" type="text" class="form" id="cuartos6" value="<?=$cuartos6?>" maxlength="20"> <br> <b>Resultado</b><br> <input name="resultado3" type="text" class="form" id="resultado3" value="<?=$resultado3?>" size="5" maxlength="20"> <br> <b>____________Partido 4</b><b>____________</b><br> <b>Equipo 1</b><br> <input name="cuartos7" type="text" class="form" id="cuartos7" value="<?=$cuartos7?>" maxlength="20"> <br> <b>Equipo 2</b><br> <input name="cuartos8" type="text" class="form" id="cuartos8" value="<?=$cuartos8?>" maxlength="20"> <br> <b>Resultado</b><br> <input name="resultado4" type="text" class="form" id="resultado4" value="<?=$resultado4?>" size="5" maxlength="20"> <br> <b>_________________________________________________________</b><br> <b>Equipos que pasaron a la Semifinal</b><br> <b> ____________Partido 1____________</b><br> <b>Equipo 1:</b><br> <input name="semifinal" type="text" class="form" id="semifinal" value="<?=$semifinal?>" maxlength="20"> <br> <b>Equipo 2:</b><br> <input name="semifinal2" type="text" class="form" id="semifinal" value="<?=$semifinal2?>" maxlength="20"> <br> <b>Resultado</b><br> <input name="resultado5" type="text" class="form" id="resultado5" value="<?=$resultado5?>" size="5" maxlength="20"> <br> <b> ____________Partido 2____________</b><br> <b>Equipo 1:</b><br> <input name="semifinal3" type="text" class="form" id="semifinal3" value="<?=$semifinal3?>" maxlength="20"> <br> <b>Equipo 2:</b><br> <input name="semifinal4" type="text" class="form" id="semifinal4" value="<?=$semifinal4?>" maxlength="20"> <br> <b>Resultado</b><br> <input name="resultado6" type="text" class="form" id="resultado6" value="<?=$resultado6?>" size="5" maxlength="20"> <br> <b>_________________________________________________________</b><br> <b>Equipo que pasaron a la Final</b><br> <b>___________Partido 1___________</b><br> <b>Equipo 1</b><br> <input name="final" type="text" class="form" id="final" value="<?=$final?>" maxlength="40"> <br> <b>Equipo 2</b><br> <input name="final2" type="text" class="form" id="final2" value="<?=$final2?>" maxlength="40"> <br> <b>Resultado</b><br> <input name="resultado7" type="text" class="form" id="resultado7" value="<?=$resultado7?>" size="5" maxlength="20"> <br> <br> <input type="submit" name="registrar" value="Editar" class="form"> </div> </form> <? } ?> [/codigo]